package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Policy;
import cn.wolfcode.crm.page.PageResult;
import cn.wolfcode.crm.query.PolicyQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PolicyMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Policy entity);

    Policy selectByPrimaryKey(Long id);

    List<Policy> selectAll();

    int updateByPrimaryKey(Policy entity);

    void savePolicyProductRelation(@Param("policyId") Long policyId, @Param("productId") Long productId);

    void deletePolicyProductRelation(Long policyId);

    int queryForCount(PolicyQueryObject qo);

    List<Policy> queryForList(PolicyQueryObject qo);

    void changeState(@Param("policyId") Long id, @Param("state") Integer state);

    void refuse(@Param("policyId") Long id, @Param("remark") String remark, @Param("state") Integer state);

    void audit(Policy policy);

    void roll(Policy policy);

    Policy getPolicyBySn(String policySn);

    List<Policy> getAllSnInfo();

    Integer getStateBypolicySn(String policySn);
    void updateState(Policy policy);
}
